﻿using Emgu.CV;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpencvProjectBase.EmguHelper.Blob
{
    public class BaseBlob
    {
        /// <summary>
        /// 提取指定阈值范围内或外的区域<br>
        /// 仿halcon的threshold</br>
        /// </summary>
        /// <returns>只有roi的原图叠加</returns>
        public Mat ThresholdMinMax(Mat src,int min,int max)
        {
            Mat dst1 = new Mat();
            Mat dst2 = new Mat();

            CvInvoke.Threshold(src, dst1, min,255,Emgu.CV.CvEnum.ThresholdType.BinaryInv);
            CvInvoke.Threshold(src, dst2, max,255,Emgu.CV.CvEnum.ThresholdType.BinaryInv);

            Mat dst = dst2 - dst1;

            return dst;

        }
        /// <summary>
        /// 提取指定阈值范围内或外的区域,并指定roi填充色<br>
        /// 仿halcon的threshold</br>
        /// </summary>
        /// <returns>只有roi的原图叠加</returns>
        public Mat ThresholdMinMax(Mat src, int min, int max,Color color)
        {
            return new Mat();
        }
    }
}
